package com.rchat.pocmini.activity.setting;

import android.content.Context;

import com.aso.common.http.delegate.HttpCallbackImpl;
import com.rchat.pocmini.activity.help.HelpContract;
import com.rchat.pocmini.common.mvp.BaseModel;
import com.rchat.pocmini.common.mvp.BasePresenter;
import com.rchat.pocmini.common.mvp.BaseView;

/**
 * Created by itsdf07 on 2017/8/19.
 */

public interface SettingContract {
    interface View extends BaseView {
        /**
         * 刷新下载进度条进度
         *
         * @param progress
         */
        void updateDownloadProgressBar(float progress);

        /**
         * 刷新版本更新进度
         *
         * @param progress
         */
        void updateCheckUpdate(int progress);

        /**
         * 刷新进程保活开关状态
         *
         * @param isKeepAlive
         */
        void updateKeepAliveStatus(boolean isKeepAlive);
    }

    abstract class Presenter extends BasePresenter<SettingContract.View, SettingContract.Model> {
        abstract void showLocationMenu(Context context);

        /**
         * 授权码激活
         *
         * @param qrCode 激活码
         */
        abstract void activate(String qrCode);

        /**
         * 检测版本更新
         */
        abstract void checkUpdate(String type);

        /**
         * 检测插件版本更新
         */
        abstract void checkPlugin();

        abstract boolean isPluginDownloading();


    }

    interface Model extends BaseModel {
        /***
         * 授权码激活
         * @param qrCode
         * @param userName
         * @param callback
         */
        void activate(String qrCode, String userName, HttpCallbackImpl callback);
    }
}
